package com.zyong.design.pattern.decorator.case2;

/**
 * @program: zyong-design-pattern
 * @ClassName: Client
 * @author: zyong
 * @create: 2024-04-28 00:31
 */
public class Client {
    public static void main(String[] args) {
        // 点一份炒饭
        FastFood firedRice = new FiredRice();
        System.out.println(firedRice.getDesc() + " " + firedRice.cost() + " 元");

        System.out.println("==================================");

        // 点一份加鸡蛋的炒饭
        FastFood eggFiredRice = new Egg(firedRice);
        System.out.println(eggFiredRice.getDesc() + " " + eggFiredRice.cost() + " 元");

        System.out.println("==================================");

        // 点一份加培根加鸡蛋的炒面
        FastFood baconEggNoodles = new Bacon(new Egg(new FiredNoodles()));
        System.out.println(baconEggNoodles.getDesc() + " " + baconEggNoodles.cost() + " 元");
    }
}
